// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_prot;

import com.nnee.p_b.p_a.cls_d;
import com.nnee.p_f.cls_b;
import com.nnee.p_f.cls_h;
import com.nnee.p_f.cls_i;
import com.nnee.p_pr.p_atom.cls_ac;
import com.nnee.p_pr.p_atom.cls_ad;
import com.nnee.p_pr.p_atom.cls_q;
import com.nnee.p_pr.p_atom.cls_s;
import com.nnee.p_pr.p_atom.cls_u;
import com.nnee.p_pr.p_atom.p_u.cls_UserInfo;
import java.io.ByteArrayOutputStream;
import java.util.Calendar;
import java.util.Iterator;
import java.util.LinkedList;

// Referenced classes of package com.nnee.p_pr.p_prot:
//            d

public class cls_n
{

    public n()
    {
    }

    private static b a(ac ac, String s1, String s2, String s3, String s4, String s5)
    {
        cls_b b1 = new cls_b("feed");
        b1.b("xmlns", "http://www.w3.org/2005/Atom");
        b1.b("xmlns:pris", "http://www.163.com/pris/1.0");
        if(ac != null)
            b1.d(ac);
        if(s1 != null)
            b1.a("id", s1);
        b1.a("title", s2);
        if(s5 != null)
            b1.f("pris:devinfo").b("id", s5);
        cls_b b2 = b1.f("author");
        if(s3 != null)
            b2.a("name", s3);
        if(s4 != null)
        {
            cls_b b3 = b1.f("link");
            b3.b("rel", "self");
            b3.b("type", "application/atom+xml");
            b3.b("href", s4);
        }
        return b1;
    }

    private static b a(com.nnee.p_pr.p_prot.cls_d d1, cls_ac ac, String s1, String s2, String s3)
    {
        cls_b b1;
        Iterator iterator;
        if(d1.g == null)
            b1 = a(ac, null, s1, null, s3, a());
        else
            b1 = a(ac, d1.g.w(), s1, d1.g.G(), s3, a());
        iterator = d1.h.iterator();
        do
        {
            if(!iterator.hasNext())
                break;
            cls_u u1 = (cls_u)iterator.next();
            if(!u1.V().equals("-1"))
            {
                cls_b b2 = e(u1.V(), u1.U(), s2);
                if(u1.S())
                {
                    cls_b b3 = b2.f("pris:customization");
                    b3.b("type", u1.bd());
                    if(u1.bf() != null)
                        b3.b("id", u1.bf());
                }
                b1.d(b2);
            }
        } while(true);
        return b1;
    }

    private static b a(String s1, cls_ac ac, String s2, String s3)
    {
        cls_b b1 = d(s1, s2, s3);
        b1.d(ac);
        return b1;
    }

    private static String a()
    {
        return com.nnee.p_pr.a.u.g(com.nnee.p_b.p_a.cls_d.h().a());
    }

    static byte[] a(ac ac)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_ad ad1 = new cls_ad();
        ad1.d(ac);
        h1.b(ad1);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(cls_u u1, String s1)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = a(((ac) (null)), null, "\u6DFB\u52A0\u6536\u85CF", null, "/favorite/add.atom", a());
        h1.b(b1);
        b1.d(e(u1.V(), u1.U(), s1));
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    public static byte[] a(cls_UserInfo userinfo)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = userinfo.l();
        b1.b("type", "update");
        h1.b(b1);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(com.nnee.p_pr.p_prot.cls_d d1, cls_ac ac, String s1)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        h1.b(a(d1, ac, "\u6211\u7684\u8BA2\u9605", s1, "/mysubscription.php"));
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(com.nnee.p_pr.p_prot.cls_d d1, String s1)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        h1.b(a(d1, ((ac) (null)), "\u6DFB\u52A0\u6536\u85CF", s1, "/favorite/add.atom"));
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(com.nnee.p_pr.p_prot.cls_d d1, String s1, String s2)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = new cls_b("sub_sources");
        h1.b(b1);
        Iterator iterator = d1.h.iterator();
        do
        {
            if(!iterator.hasNext())
                break;
            cls_u u1 = (cls_u)iterator.next();
            if(!u1.V().equals("-1"))
                b1.a("id", u1.V());
        } while(true);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(String s1, String s2)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = a(((ac) (null)), null, "\u5220\u9664\u6211\u7684\u6536\u85CF", null, "/favorite/del.atom", null);
        h1.b(b1);
        b1.d(e(s1, null, s2));
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(String s1, String s2, String s3)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = d(s1, "Atom-Powered Robots Run Amok", s2);
        h1.b(b1);
        b1.a("content", s3);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(String s1, String s2, String s3, float f)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = d(s1, "Atom-Powered Robots Run Amok", s2);
        h1.b(b1);
        b1.a("content", s3);
        b1.f("pris:ranking").b("value", Float.toString(f));
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(String s1, String s2, String s3, cls_ac ac)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = a(ac, null, null, null, ((String) (null)), a());
        h1.b(b1);
        cls_b b2 = new cls_b("entry");
        if(s1 != null)
            b2.d(new cls_b("id", s1));
        if(s2 != null)
        {
            cls_b b3 = new cls_b("content", s2);
            b3.b("type", "text");
            b2.d(b3);
        }
        if(s3 != null)
            b2.d(new cls_b("is_comment", s3));
        b1.d(b2);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(String s1, String s2, String s3, cls_s s4)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = d(s1, "Atom-Powered Robots Run Amok", s2);
        h1.b(b1);
        b1.a("content", s3);
        if(s4 == s.a)
            b1.f("pris:bump").b("action", "up");
        else
            b1.f("pris:bump").b("action", "down");
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(String s1, String s2, String s3, String s4)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = d(s1, "Atom-Powered Robots Run Amok", s2);
        h1.b(b1);
        b1.a("content", s3);
        b1.f("pris:sharing").b("action", s4);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(String s1, String s2, String s3, String s4, cls_ac ac)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = a(s1, ac, "Atom-Powered Robots Run Amok", s2);
        if(s4 != null)
            b1.a("cid", s4);
        h1.b(b1);
        b1.a("content", s3);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    public static byte[] a(String s1, String s2, String s3, String s4, cls_ac ac, String s5)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = a(ac, null, "\u6211\u7684\u8BA2\u9605", s5, "/customNode/subscribe.atom", a());
        h1.b(b1);
        cls_b b2 = e(s1, s2, s5);
        if(s3 != null)
        {
            cls_b b3 = b2.f("pris:customization");
            b3.b("type", s3);
            if(s4 != null)
                b3.b("id", s4);
        }
        b1.d(b2);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] a(LinkedList linkedlist, String s1, String s2, String s3)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = a(((ac) (null)), null, "\u4E3E\u62A5\u975E\u6CD5\u6E90", s3, "/article/ilg.atom", a());
        h1.b(b1);
        Iterator iterator = linkedlist.iterator();
        do
        {
            if(!iterator.hasNext())
                break;
            cls_u u1 = (cls_u)iterator.next();
            if(!u1.V().equals("-1"))
            {
                cls_b b2 = e(u1.V(), s1, s3);
                b1.d(b2);
                if(u1.J() && u1.e().a() != null)
                    b2.a("updated", u1.Y());
                b2.a("content", s2).b("type", "text");
            }
        } while(true);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] b(ac ac)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        h1.b(a(((String) (null)), ac, null, ((String) (null))));
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] b(com.nnee.p_pr.p_prot.cls_d d1, cls_ac ac, String s1)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        h1.b(a(d1, ac, "\u5220\u9664\u6211\u7684\u8BA2\u9605", s1, "/sub/del.atom"));
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] b(com.nnee.p_pr.p_prot.cls_d d1, String s1)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        h1.b(a(d1, ((ac) (null)), "\u5220\u9664\u6211\u7684\u6536\u85CF", s1, "/favorite/del.atom"));
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] b(String s1, String s2)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = h1.c("userinfo", null);
        b1.b("type", "modifypassword");
        b1.a("old", s1);
        b1.a("new", s2);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] b(String s1, String s2, String s3)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = d(s1, "Atom-Powered Robots Run Amok", s2);
        h1.b(b1);
        b1.a("content", s3);
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] c(com.nnee.p_pr.p_prot.cls_d d1, cls_ac ac, String s1)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        h1.b(a(d1, ac, "\u6211\u7684\u8BA2\u9605", null, "/sub/list.atom"));
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    static byte[] c(String s1, String s2, String s3)
    {
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        cls_h h1 = new cls_h(bytearrayoutputstream);
        cls_b b1 = a(((ac) (null)), null, "\u4E3E\u62A5\u975E\u6CD5\u6E90", s3, "/article/ilg.atom", a());
        h1.b(b1);
        cls_b b2 = e(s1, "\u4E3E\u62A5\u539F\u56E0", s3);
        b1.d(b2);
        b2.a("content", s2).b("type", "text");
        h1.a();
        return bytearrayoutputstream.toByteArray();
    }

    private static b d(String s1, String s2, String s3)
    {
        cls_b b1 = e(s1, s2, s3);
        b1.b("xmlns", "http://www.w3.org/2005/Atom");
        b1.b("xmlns:pris", "http://www.163.com/pris/1.0");
        b1.a("updated", q.a(Calendar.getInstance().getTime()));
        return b1;
    }

    private static b e(String s1, String s2, String s3)
    {
        cls_b b1 = new cls_b("entry");
        b1.a("id", s1);
        if(s2 != null)
            b1.a("title", s2);
        if(s3 != null)
            b1.f("author").a("name", s3);
        b1.f("pris:devinfo").b("id", a());
        return b1;
    }

    static String a = "ATOMXMLCreator";

}
